using System;
using System.Collections.Generic;
using System.Xml.Serialization;

namespace ClientTools.Server.Webservices.ConfigClasses
{
    [Serializable]
    [XmlRoot]
    public class ClientTools
    {
        public bool _enabled;

        [XmlAttribute("enabled")]
        public bool Enabled
        {
            get { return _enabled; }
            set { _enabled = value; }
        }

        private List<User> _users = new List<User>();

        [XmlElement(ElementName = "User")]
        public List<User> Users
        {
            get { return _users; }
            set { _users = value; }
        }

        public User GetUserByName(string userName)
        {
            foreach (User user in this.Users)
            {
                if (user.Name == userName)
                {
                    return user;
                }
            }
            return null;
        }
    }
}
